package com.chinasoft.reposearch.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.chinasoft.reposearch.entity.po.TopicCount;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface TopicCountMapper extends BaseMapper<TopicCount> {
    @Select("select topic, year, SUM(count) as count from topic_count where topic = #{topic} and year between #{start} and #{end} group by topic, year")
    List<TopicCount> selectListYears(String topic, Integer start, Integer end);
}
